<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<input type="text" v-model="n1" />
			<select v-model="op">
				<option value="+">+</option>
				<option value="-">-</option>
				<option value="*">*</option>
				<option value="/">/</option>
			</select>
			<input type="text" v-model="n2" />
			<input type="button" value="=" @click="calc" />
			<input type="text" v-model="result"/>
		</div>
		<script type="text/javascript">
			new Vue({
				el:"#app",
				data:{
					n1:"",
					n2:"",
					result:"",
					op:"+"
				},
				methods:{
					calc:function(){
						switch (this.op){
							case "+":
							this.result=parseInt(this.n1)+parseInt(this.n2);
								break;
							case "-":
							this.result=parseInt(this.n1)-parseInt(this.n2);
								break;
							case "*":
							this.result=parseInt(this.n1)*parseInt(this.n2);
								break;
							case "/":
							this.result=parseInt(this.n1)/parseInt(this.n2);
								break;
						}
					}
				}
			})
		</script>
	</body>
</html>
